home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmConnection
- BackColor = &H00C0C0C0&
- ClientHeight = 3000
- ClientLeft = 1740
- ClientTop = 2835
- ClientWidth = 3645
- ControlBox = 0 'False
- Height = 3405
- Left = 1680
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MDIChild = -1 'True
- MinButton = 0 'False
- ScaleHeight = 3000
- ScaleWidth = 3645
- Top = 2490
- Width = 3765
- WindowState = 2 'Maximized
- Begin CommandButton cmdConnect
- Caption = "Connect"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 105
- TabIndex = 6
- Top = 1725
- Width = 975
- End
- Begin CommandButton cmdDisconnect
- Caption = "Disconnect"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 1185
- TabIndex = 5
- Top = 1725
- Width = 975
- End
- Begin CommandButton cmdReinit
- Caption = "Reinit"
- Enabled = 0 'False
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 2265
- TabIndex = 4
- Top = 1725
- Width = 975
- End
- Begin TextBox txtHost
- Height = 285
- Left = 1065
- TabIndex = 3
- Top = 45
- Width = 2175
- End
- Begin TextBox txtUsername
- Height = 285
- Left = 1065
- TabIndex = 2
- Top = 405
- Width = 2175
- End
- Begin TextBox txtPassword
- Height = 285
- Left = 1065
- TabIndex = 1
- Top = 765
- Width = 2175
- End
- Begin TextBox txtAccount
- Height = 285
- Left = 1065
- TabIndex = 0
- Top = 1125
- Width = 2175
- End
- Begin Timer Timer1
- Interval = 100
- Left = 105
- Top = 2325
- End
- Begin Label Label1
- Alignment = 1 'Right Justify
- BackColor = &H00C0C0C0&
- Caption = "Host:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 105
- TabIndex = 10
- Top = 45
- Width = 855
- End
- Begin Label Label2
- Alignment = 1 'Right Justify
- BackColor = &H00C0C0C0&
- Caption = "Username:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 105
- TabIndex = 9
- Top = 405
- Width = 855
- End
- Begin Label Label3
- Alignment = 1 'Right Justify
- BackColor = &H00C0C0C0&
- Caption = "Password:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 105
- TabIndex = 8
- Top = 765
- Width = 855
- End
- Begin Label Label4
- Alignment = 1 'Right Justify
- BackColor = &H00C0C0C0&
- Caption = "Account:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 105
- TabIndex = 7
- Top = 1125
- Width = 855
- End
- Option Explicit
- Dim fConnected As Integer
- Dim foo As Integer
- Private Sub cmdConnect_Click ()
- MainForm.FTP1.Host = txtHost.Text
- MainForm.FTP1.LogonName = txtUsername.Text
- MainForm.FTP1.LogonPassword = txtPassword.Text
- MainForm.FTP1.Account = txtAccount.Text
- cmdConnect.Enabled = False
- If (ExecuteCommand(FtpActionConnect) <> 0) Then
- cmdConnect.Enabled = True
- End If
- End Sub
- Private Sub cmdDisconnect_Click ()
- Dim foo As Integer
- foo = ExecuteCommand(FtpActionDisconnect)
- End Sub
- Private Sub cmdReinit_Click ()
- foo = ExecuteCommand(FtpActionReinitialize)
- End Sub
- Private Sub Form_Load ()
- txtHost.Text = "ftp.mabry.com"
- txtUsername.Text = "anonymous"
- txtPassword.Text = "test@ftp.ocx"
- fConnected = False
- Me.Show
- End Sub
- Private Sub Timer1_Timer ()
- If (fConnected = False And MainForm.FTP1.State = 1) Then
- cmdDisconnect.Enabled = True
- cmdConnect.Enabled = False
- cmdReinit.Enabled = True
- fConnected = True
- ElseIf (fConnected = True And MainForm.FTP1.State = 0) Then
- cmdDisconnect.Enabled = Not True
- cmdConnect.Enabled = Not False
- cmdReinit.Enabled = Not True
- fConnected = False
- End If
- End Sub
-